/**
 * 
 */
package com.imonsoft.common.html;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author LiQianHui
 * @date 2013-04-17
 * @version 2013
 */
public class RadioGroup implements Serializable {

	private static final long serialVersionUID = -1357883121965046519L;

	private List<Radio> radioList = new ArrayList<Radio>();

	public void addRadio(String name, String value, String text, boolean checked) {
		radioList.add(new Radio(name, value, text, checked));
	}

	@Override
	public String toString() {
		String radioGroupHtml = "";
		for (Radio radio : radioList) {
			radioGroupHtml += radio.toString();
		}
		return radioGroupHtml;
	}

	public static void main(String[] args) {
		RadioGroup radioGroup = new RadioGroup();
		radioGroup.addRadio("sexCode", "01", "男性", false);
		radioGroup.addRadio("sexCode", "02", "女性", true);
		System.out.println(radioGroup);
	}
}
